<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  // Promise.all([]) 数组里的请求都完成之后才会进入then
  Promise.all([
    // new Promise((resolve, reject) => {
    //   $.ajax({
    //     uri: "url1",
    //     success: function (data) {
    //       resolve(data)
    //     }
    //   })
    // }),
    // new Promise((resolve, reject) => {
    //   $.ajax({
    //     uri: "url2",
    //     success: function (data) {
    //       resolve(data)
    //     }
    //   })
    // })

    new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({name: "aa", age: 1});
      }, 1000)
    }),
    new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({name: "bb", age: 2});
      }, 2000)
    })
  ]).then(results => {
    console.log(results);
  })
</script>
</body>
</html>